/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package entidades;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 *
 * @author Andres
 */
@Embeddable
public class EstudiopersonaPK implements Serializable {
    @Basic(optional = false)
    @Column(name = "PERSONA_CODIGOPERSONA", nullable = false)
    private int personaCodigopersona;
    @Basic(optional = false)
    @Column(name = "ESTUDIOS_CODIGO", nullable = false)
    private int estudiosCodigo;

    public EstudiopersonaPK() {
    }

    public EstudiopersonaPK(int personaCodigopersona, int estudiosCodigo) {
        this.personaCodigopersona = personaCodigopersona;
        this.estudiosCodigo = estudiosCodigo;
    }

    public int getPersonaCodigopersona() {
        return personaCodigopersona;
    }

    public void setPersonaCodigopersona(int personaCodigopersona) {
        this.personaCodigopersona = personaCodigopersona;
    }

    public int getEstudiosCodigo() {
        return estudiosCodigo;
    }

    public void setEstudiosCodigo(int estudiosCodigo) {
        this.estudiosCodigo = estudiosCodigo;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (int) personaCodigopersona;
        hash += (int) estudiosCodigo;
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof EstudiopersonaPK)) {
            return false;
        }
        EstudiopersonaPK other = (EstudiopersonaPK) object;
        if (this.personaCodigopersona != other.personaCodigopersona) {
            return false;
        }
        if (this.estudiosCodigo != other.estudiosCodigo) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entidades.EstudiopersonaPK[personaCodigopersona=" + personaCodigopersona + ", estudiosCodigo=" + estudiosCodigo + "]";
    }

}
